package com.flight.trans.adapter;

import android.content.Context;
import android.widget.TextView;

import com.flight.trans.R;
import com.flight.trans.base.BaseRecyclerAdapter;
import com.flight.trans.base.BaseViewHolder;
import com.flight.trans.bean.FlightBean.FlightData;
import com.flight.trans.bean.StorageAreaBean.StorageAreaData;

import java.util.List;

/**
 * 区域
 */
public class FlightAdapter extends BaseRecyclerAdapter<FlightData> {

    public FlightAdapter(Context mContext, List<FlightData> mList) {
        super(mContext, mList);
    }

    @Override
    public int setContentView() {
        return R.layout.adapter_storage_area;
    }

    @Override
    protected void bindData(BaseViewHolder holder, FlightData data, int position) {
        TextView mTvStorageArea = holder.findViewById(R.id.mTvStorageArea);
        mTvStorageArea.setText(data.getFlightNo2() + " / " + data.getOriginStation());

        mTvStorageArea.setBackground(mContext.getResources().getDrawable(data.isSelected() ? R.drawable.shape_orange_5 : R.drawable.shape_blue_5));

        setOnItemClickListener(mTvStorageArea , position);
    }
}
